<template>
  <img
    class="avatar-container"
    :src="server_URL + url"
    :style="{ width: size + 'px', height: size + 'px' }"
  />
</template>

<script>
import { server_URL } from "@/urlConfig";
export default {
  data() {
    return {
      server_URL,
    };
  },
  // props: ['url']
  props: {
    url: {
      type: String,
      required: true,
    },
    size: {
      type: Number,
      default: 150,
    },
  },
};
</script>

<style lang="less" scoped>
// 带有作用域的样式
.avatar-container {
  border-radius: 50%;
  object-fit: cover;
  display: block;
}
</style>
